package se.cefalo.ceti.ical;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

/**
 * Created by IntelliJ IDEA.
 * User: kopo700
 * Date: Oct 31, 2006
 * Time: 3:19:01 PM
 * To change this template use File | Settings | File Templates.
 */
public class IcalValidator implements Validator {
    public boolean supports(Class clazz) {
        return IcalUrl.class.equals(clazz);
    }

    public void validate(Object target, Errors errors) {
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "icalUrl", "url.required", "No url given");
    }
}
